// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.Security
{
	public sealed class SecurityClearCachedRealmsRequestParameters : RequestParameters<SecurityClearCachedRealmsRequestParameters>
	{
		[JsonIgnore]
		public IEnumerable<string>? Usernames { get => Q<IEnumerable<string>?>("usernames"); set => Q("usernames", value); }
	}

	public sealed partial class SecurityClearCachedRealmsRequest : PlainRequestBase<SecurityClearCachedRealmsRequestParameters>
	{
		public SecurityClearCachedRealmsRequest(Elastic.Clients.Elasticsearch.Names realms) : base(r => r.Required("realms", realms))
		{
		}

		internal override ApiUrls ApiUrls => ApiUrlsLookups.SecurityClearCachedRealms;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => false;
		[JsonIgnore]
		public IEnumerable<string>? Usernames { get => Q<IEnumerable<string>?>("usernames"); set => Q("usernames", value); }
	}

	public sealed partial class SecurityClearCachedRealmsRequestDescriptor : RequestDescriptorBase<SecurityClearCachedRealmsRequestDescriptor, SecurityClearCachedRealmsRequestParameters>
	{
		internal SecurityClearCachedRealmsRequestDescriptor(Action<SecurityClearCachedRealmsRequestDescriptor> configure) => configure.Invoke(this);
		public SecurityClearCachedRealmsRequestDescriptor(Elastic.Clients.Elasticsearch.Names realms) : base(r => r.Required("realms", realms))
		{
		}

		internal SecurityClearCachedRealmsRequestDescriptor()
		{
		}

		internal override ApiUrls ApiUrls => ApiUrlsLookups.SecurityClearCachedRealms;
		protected override HttpMethod HttpMethod => HttpMethod.POST;
		protected override bool SupportsBody => false;
		public SecurityClearCachedRealmsRequestDescriptor Usernames(IEnumerable<string>? usernames) => Qs("usernames", usernames);
		public SecurityClearCachedRealmsRequestDescriptor Realms(Elastic.Clients.Elasticsearch.Names realms)
		{
			RouteValues.Required("realms", realms);
			return Self;
		}

		protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
		{
		}
	}
}